﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.Cryptography;
 
public class SHA1Calculator
{
    public static void Main()
    {
        using (FileStream fs = new FileStream("test.txt", FileMode.Open))
        {
            using (SHA1Managed sha1Instance = new SHA1Managed())
            {
                byte[] hash = sha1Instance.ComputeHash(fs);
                foreach (byte b in hash)
                {
                    Console.Write(b.ToString("X2"));
                }
                Console.WriteLine();
            }
        }
    }

}
 